﻿using System;

namespace EduFormManager.Models
{
    [Serializable]
    public class MunicipalityOwnesFormsView : Entity
    {
        public virtual Municipality Municipality { get; set; }
        public virtual Allform Allform { get; set; }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((MunicipalityOwnesFormsView) obj);
        }

        protected bool Equals(MunicipalityOwnesFormsView other)
        {
            return Equals(Municipality.Id, other.Municipality.Id) && Equals(Allform.Id, other.Allform.Id);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return ((Municipality != null ? Municipality.GetHashCode() : 0) * 397) ^ (Allform != null ? Allform.GetHashCode() : 0);
            }
        }
    }
}
